//  PULSAR, THE GAME
//  ================================
//  COPYRIGHT(c) 2013 BY KAMIL MRZYGŁÓD
//  CODENOVA.PL

// RequireJS config
requirejs.config({
    baseUrl: '../Source/Js/Engine',
    paths: {},
    urlArgs: "ts=" + (new Date()).getTime()
});

// Start the main app logic
requirejs(['Engine', 'Stage', 'Viewport', 'Ui/Ui', 'Ui/Block', 'Space/Planet'], function(Engine, Stage, Viewport, Ui, Block, Planet) {
    // Start engine!
    var engine = Engine({
        Environment: 'dev'
    });
    engine.Initialize();

    // Create main stage
    var mainStage = Stage('main', engine.WS);

    // Create UI for main stage
    mainStage.RegisterUi(Ui);

    // Register elements for UI
    mainStage.Ui.RegisterElement(Block('topBar'));

    // Create Viewport
    mainStage.RegisterViewport(Viewport, 'planet');

    // Register elements for Viewport
    mainStage.Viewports['planet'].RegisterElement(Planet());

    // Initialize whole stage
    mainStage.Initialize();
    console.log(mainStage);
});